<%
var headerPart = {
%>
<script type="text/javascript">

</script>
<% }; %>
<% layout("/layouts/micro.html",{headerSection:headerPart}){ %>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/cms/guestbook/">留言列表</a></li>
		<li class="active"><a href="${ctx}/cms/guestbook/form?id=${guestbook.id}">留言<%if(shiro.hasPermission("cms:guestbook:edit")){%>${guestbook.delFlag == '2'?'审核':'查看'}<%}%><%if(shiro.lacksPermission("cms:guestbook:edit")>查看<%}%></a></li>
	</ul><br/>
	<form id="inputForm" modelAttribute="guestbook" action="${ctx}/cms/guestbook/save" method="post" class="layui-form">
		<input type="hidden" name="id" value="${guestbook.id}"/>
		<input type="hidden" name="delFlag" value="${guestbook.delFlag}"/>
		<#message content="${message!}"/>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">名称:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.name}</div>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label">邮箱:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.email}</div>
				</div>
			</div>
		</div>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">电话:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.phone}</div>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label">单位:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.workunit}</div>
				</div>
			</div>
		</div>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md6">
				<label class="layui-form-label">留言分类:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${@DictUtils.getDictLabel(guestbook.type, 'cms_guestbook', '无')}</div>
				</div>
			</div>
			<div class="layui-col-md6">
				<label class="layui-form-label">IP:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.ip}</div>
				</div>
			</div>
		</div>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md12">
				<label class="layui-form-label">留言时间:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.createDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</div>
				</div>
			</div>
		</div>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md12">
				<label class="layui-form-label">留言内容:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.content}</div>
				</div>
			</div>
		</div>
		<%if(isNotEmpty(guestbook.reUser)){%>
		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md12">
				<label class="layui-form-label">回复人:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.reUser.name}</div>
				</div>
			</div>
		</div>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md12">
				<label class="layui-form-label">回复时间:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.reDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</div>
				</div>
			</div>
		</div>

		<div class="layui-row layui-col-space15 layui-form-item">
			<div class="layui-col-md12">
				<label class="layui-form-label">回复时间:</label>
				<div class="layui-input-block">
					<div class="layui-form-mid">${guestbook.reContent}</div>
				</div>
			</div>
		</div>
		<%}%>

		<div class="layui-form-item">
			<div class="layui-input-block">
			<%if(guestbook.delFlag == '2')%>
			<%if(shiro.hasPermission("cms:guestbook:edit")){%>
				<input id="btnSubmit" class="layui-btn btn-default" type="submit" value="通 过" onclick="$('#delFlag').val('0')"/>&nbsp;
				<input id="btnSubmit" class="layui-btn btn-danger" type="submit" value="驳 回" onclick="$('#delFlag').val('1')"/>&nbsp;
			<%}%>
			<%}%>
				<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
			</div>
		</div>
	</form>
<%}%>